package br.consultorio.digital.modelo.entidade;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import br.consultorio.digital.R;

public class AgendaDataAdapter extends BaseAdapter {

	/**
	 * * Adapter utilizado para exibir as informa��es dos Estados * no
	 * ListView. * @author Administrador *
	 */
	private Context context;
	private List<Object> pList;

	public AgendaDataAdapter(Context context, List<Object> statelist) {
		this.context = context;
		this.pList = statelist;
	}

	public int getCount() {
		return pList.size();
	}

	public Object getItem(int position) {
		return pList.get(position);
	}

	public long getItemId(int position) {
		return pList.get(position).hashCode();
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		// Recupera o estado da posi��o atual

		Object p = pList.get(position);
		// Cria uma inst�ncia do layout XML para os objetos correspondentes na
		// View

		LayoutInflater inflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

		View view = inflater.inflate(R.layout.agendadataitem, null);

		TextView dhAtividade = (TextView) view
				.findViewById(R.idAgendaData.dhAgenda);

		dhAtividade.setText(p.toString());

		return view;
	}
}
